VERSION 5.00
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmOverride 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Override"
   ClientHeight    =   1590
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4170
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1590
   ScaleWidth      =   4170
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame1 
      Height          =   1155
      Left            =   60
      TabIndex        =   4
      Top             =   0
      Width           =   4035
      Begin ITGControls.ITGTextBox txtPassword 
         Height          =   285
         Left            =   300
         TabIndex        =   1
         Top             =   660
         Width           =   3360
         _ExtentX        =   5715
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Passwordchar    =   "*"
         Label           =   "Overriding Password"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1600
         TextBoxWidth    =   1700
      End
      Begin ITGControls.ITGTextBox txtCEOUName 
         Height          =   285
         Left            =   300
         TabIndex        =   0
         Top             =   300
         Width           =   3360
         _ExtentX        =   5715
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   "CEO User Name"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1600
         TextBoxWidth    =   1700
      End
   End
   Begin ITGControls.ITGCommandButton cmdCancel 
      Height          =   345
      Left            =   2880
      TabIndex        =   3
      Top             =   1200
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   609
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "&Cancel"
   End
   Begin ITGControls.ITGCommandButton cmdOK 
      Height          =   345
      Left            =   1620
      TabIndex        =   2
      Top             =   1200
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   609
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "&OK"
   End
End
Attribute VB_Name = "frmOverride"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IT Group Inc. 2005.09.23

Option Explicit

Enum eOverridingType
    O_SO
    O_DR
    O_SI
End Enum
Public mOverridingType As eOverridingType

Private Sub cmdCancel_Click()
    gAction = G_Cancel
    Unload Me
End Sub

Private Sub cmdOK_Click()
Dim sPW As String
    If Trim(txtCEOUName) = "" Then
        MsgBox "Please enter valid user name.", vbInformation, "ComUnion"
        txtCEOUName.SetFocus
        Exit Sub
    End If
    sPW = GetValueFrTable("Password", "SEC_USER", "UserID = '" & (txtCEOUName) & "' AND RoleID = 'CEO'", True)
    If Trim(UCase(txtPassword)) <> UCase(Decrypt(Trim(sPW))) Then
        MsgBox "Invalid CEO User Name or Overriding password.", vbCritical, "ComUnion"
        txtCEOUName.SetFocus
    Else
        Select Case mOverridingType
            Case O_SO
                UpdateLogFile "Overriding Approval (SO)", RepName, "Override"
            Case O_DR
                UpdateLogFile "Overriding Approval (DR)", RepName, "Override"
            Case O_SI
                UpdateLogFile "Overriding Approval (SI)", RepName, "Override"
        End Select
        gAction = G_OK
        Unload Me
    End If
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyEscape Then
        gAction = G_Cancel
        Unload Me
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    RepName = ""
    Set frmOverride = Nothing
End Sub

Private Sub txtPassword_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        cmdOK_Click
    End If
End Sub
